<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>审图模块页面-查看图纸</title>
    <meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1">
    <meta name="viewport"
          content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <meta http-equiv="Expires" CONTENT="0">
    <meta http-equiv="Cache-Control" content="no-siteapp,no-transform,no-store, no-cache, must-revalidate">
    <meta http-equiv="Pragma" content="no-cache">
    <link rel="shortcut icon" href="./../../../favicon.ico" type="image/x-icon"/>
    <link rel="stylesheet" href="./../../../static/css/font.css">
    <link rel="stylesheet" href="./../../../static/css/weadmin.css">
    <script type="text/javascript" src="/lib/layui/layui.js" charset="utf-8"></script>
    <link rel="stylesheet" href="../../../static/css/buildUnit/common.css">
    <script type="text/javascript" src="/lib/mxDraw/mxcustom.js"></script>
    <style>
        body {
            padding: 0;
            -webkit-box-sizing: border-box;
            -moz-box-sizing: border-box;
            box-sizing: border-box;
            height:100%;
        }
        #content{
            height:100%;
        }
        .drawingObj {
            height: 100%;
            width: 100%;
        }
        #iStylePDF{
            vertical-align: middle;
        }
    </style>
</head>
<body>
<div id="content">

</div>
<script src="../../../static/js/main.js"></script>
<!-- pdf批注完成事件 -->
<script language="javascript" for=iStylePDF event="OnAnnotFinished(Annot, wParam, lParam)">
    layui.use(['pdf'], function () {
        var pdf = layui.pdf;
        pdf.suggestAdd(Annot, wParam, lParam);
    });
</script>
<!-- pdf双击圈阅修改事件 -->
<script language="javascript" for=iStylePDF event="OnAddinEventInvoke(EventName, Addin, wParam, lParam)">
    if (EventName == "iStylePDF.Annots:LButtonDblClk") {
        layui.use(['pdf'], function () {
            var pdf = layui.pdf;
            pdf.suggestEdit(EventName, Addin, wParam, lParam);
        });
        Addin.MsgHandle = true;
    }
</script>
<script>
    //例子图纸：http://61.55.140.248:8094/ysb_store_path/drawing/6e6fbe961ac84e768f8e2c76fe65520d/761364b59d4a4804b695d9d95103ea83/b084bdeed5854c1ba80ecd5e1113bb2f.dwg
    layui.use([
        'layer',
        'mxDraw',
        'configure',
        'jquery',
        'sessionFun',
        'matchType',
        'bluebird',
        'pdf',
        'pdfXiaoling',
        'configureCom'
    ], function () {
        var configure = layui.configure;
        var $ = layui.jquery;
        var mxDraw = layui.mxDraw;
        var sessionFun = layui.sessionFun;
        var matchType = layui.matchType;
        var pdf = layui.pdf;
        var pdfXiaoling = layui.pdfXiaoling;
        var token=localStorage.getToken;
        var configureCom = layui.configureCom;
        //获取当前审查对象
        var listData = sessionFun.get(configure.SESSION_PROJECT_WAIT_LIST_DATA);
        //获取文件树选中对象
        var fileTreeData = sessionFun.get(configure.SESSION_FILE_TREE_DATA);
        //获取当前图纸
        var drawingData = sessionFun.get(configure.SESSION_CKTZ_INFO_DATA);
        //通过图纸名称，获得图纸类型
        var fileType = configureCom.GetQueryString('fileType');//matchType.init(drawingData.name);
        var fileId = configureCom.GetQueryString('fileId');
        //demo图纸
        //var path = fileTreeData.path +'/'+ drawingData.name;
        //var url = configure.HOST + configure.DRAWING_WATCH + '?decId=' + listData.decId + '&filePath=' + encodeURIComponent(path) + '&token=' + configureCom.getToken();
        var url = 'http://61.55.140.248:7000/api/sys/doc/att/'+fileId+'?token='+token;
        if (fileType === 'pdf') {
            //pdf初始化
             pdf.init('iStylePDF', url, '#content');
            //pdfXiaoling.init('iStylePDF', url, '#content');
        } else {
            //cad图纸初始化
            mxDraw.init('drawingId', url, 'http://www.mxdraw.com/MxDrawX52.CAB#version=8.0.0.1', '#content');
        }
    });

</script>
</body>
</html>